-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reworked TMHM into expandable list format #2233
Conversation
You skipped the use of P_NEW_POKEMON to enable some entries? |
Checks for Preprocessor if statements could be introduced (re-introduced?) to tmhm_learnets.h, but I doubt it really makes much of a difference in the end. edit: just checked, only 2 exist in level_up_learnsets.h, so moving those over would be super trivial if they're wanted for reasons that I'm missing or just for consistency's sake |
|
Fixed. |
Speaking of space, I think it's important to keep in mind this will at least double the space used for this, maybe even triple. |
The space taken up is pretty negligible. It's certainly more than the existing table and even the 128-bit expansion, but it's still incredibly tiny. The current master branch of the expansion, even with nothing disabled (all the cries, graphics, etc.) and with this change added, takes up only about 23.8MB of the available 32MB in the ROM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 additional things:
-
Spaces instead of tabs in
tmhm_learnsets.h
-
Something that I've been thinking is that in vanilla, TMs/HMs and Tutor Moves don't overlap in terms of moves that can be taught. And even if they did, I doubt that they would be able to be learned with one method and not the other. My thought is that we could potentially unify both TM and Tutor tables into a single list, seeing as not only
CanMonLearnTMTutor
is already used by both, but it would further simplify modifying both Tutors and TMs (eg: no need forTUTOR_MOVE_*
and stuff).
Co-authored-by: Eduardo Quezada D'Ottone <[email protected]>
Updated the tabs to spaces, haven't committed it yet pending the following:
I can see that working for most use cases, but not all. For example, if you have one-use TMs (or TRs, if those are implemented) then you could give the player one for a fairly powerful move early on. Then later, maybe you want to grant access to a tutor that can teach it infinitely in exchange for a Star Piece or something. Can't imagine stuff like that would be super common, but it isn't out of the question. I think it'd definitely still be possible to trim down some of the code if I set up the tutor movelists in the same way, though. I can give it a shot if it'd be better to merge it alongside this change rather than via a separate PR. |
I don't how that couldn't work with what I proposed. If the mon is able to learn the move with a single-use TM, it should also be able to learn that move from that Star Piece Tutor if both instances are read from the same move compatibility table. |
That's true, I don't know why I was thinking the method would matter. The thing in question would be "should a species be able to learn a certain move from a TM and not a Tutor, or vice versa?" and I really can't think of any examples where anyone would want that. I'll see what I can do, but I'll probably have to set up a script of some sort this time since I'll need to merge the arrays. |
Either that, or we could wait until I add beta PoryMoves support for this 👀. Don't know how long that would take though, I tend to get distracted a lot lol |
Massive changes with ed02c4b. Boom.
I did testing with Treecko to check TMs, HMs, and tutors as well as move-overwriting for each. May need additional testing though. Initially had issues regarding the move being stored in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, this is great to see!
Though, there are some things that I feel should be changed name-wise:
-
gTeachLearnsets
->gTMTutorLearnsets
-
CanMonLearnTaughtMove
->CanMonLearnTMTutorMove
-
CanSpeciesLearnTaughtMove
->CanSpeciesLearnTMTutorMove
-
CanMonLearnMove
->CanMonLearnTMTutor
-
teach_learnset_pointers.h
->tm_tutor_learnset_pointers.h
-
teach_learnsets.h
->tm_tutor_learnsets.h
-
sSPECIESTeachLearnset
->sSPECIESTMTutorLearnset
Discussed on Discord, updated in f8fb4e8. |
Rushed the initial changes to Battle Frontier and assumed some variables meant something they didn't actually. Now, having fully deciphered the spaghetti, the tutors should actually be fixed in 9f16d1d. Gotta love multi-use unnamed variables. |
Requested changes were implemented.
Ported from RHH. Credits to them + rh-hideout/pokeemerald-expansion#2233
Description
Completely removed the need for bit arrays, instead using the format of
gLevelUpLearnsets
as a guide to rework TMs/HMs entirely. TMHM lists useMOVE_UNAVAILABLE
as a footer to allow proper looping, since dynamic arrays can't have their sizes determined at compile time.gLevelUpLearnsets
uses an identical method throughLEVEL_UP_END
which shares the same value (max size u16, i.e. 0xFFFF). Optionally, a new preprocessor define could be used instead for the footer to prevent issues with any future integer type modifications.Discord contact info
Crater#7777